<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
    <title>Welcome</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="js/jquery-3.5.1.min.js"></script>
    <script src="js/bootstrap.bundle.min.js"></script>
</head>
<body>
<br>
    <div align="center">
        <span id="welcome">处理中...</span>
    </div>
</body>
<script type="text/javascript">
    $(function () {
        var token = document.cookie.replace(/(?:(?:^|.*;\s*)token\s*\=\s*([^;]*).*$)|^.*$/, "$1");
        $.ajax({
            method: "POST",
            url: 'http://www.test.com/api/user/info/' + (token.length==0?"-1":token),
            data: {}
        }).done(function (data, textStatus) {
            if( data.status == 0 ){
                $('#welcome').text(data.data + ",欢迎登录系统！");
            } else {
				alert("未登陆!");
                window.location.replace("http://www.test.com/static/login.html");
            }
        }).fail(function (jqXHR, textStatus) {
            alert("Request failed: " + jqXHR.statusText);
            window.location.replace("http://www.test.com/static/login.html");
        })
    });
</script>
</html>